#ifndef WEBCAM_H
#define WEBCAM_H

#define CLEAR(x) memset (&(x), 0, sizeof (x))

#include <linux/videodev2.h>

struct buffer {
        void *                  start;
        size_t                  length;
};

void open_webcam(char *name);
extern int webfd;
extern struct buffer *buffers;

int ctl_webcam(int request, void *arg);

void close_webcam();
void init_webcam();
void start_webcam();
void stop_webcam();
int getbuffer_webcam();
void releasebuffer_webcam();
void setstarttime();
double capturetime(struct v4l2_buffer * buf);
double timefromstart();

#endif
